﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows;

namespace ZGRemote.Server.UI.Controls
{
    public class SettingItem : HeaderedContentControl
    {
        public object Tip
        {
            get { return (object)GetValue(HeaderProperty); }
            set { SetValue(HeaderProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Header.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TipProperty =
            DependencyProperty.Register("Tip", typeof(object), typeof(SettingItem), new PropertyMetadata(null, OnTipChanged));

        private static void OnTipChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.NewValue != null)
            {
                d.SetValue(HasTipProperty, true);
            }
        }

        public bool HasTip
        {
            get { return (bool)GetValue(HasTipProperty); }
            set { SetValue(HasTipProperty, value); }
        }

        // Using a DependencyProperty as the backing store for HasTip.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty HasTipProperty =
            DependencyProperty.Register("HasTip", typeof(bool), typeof(SettingItem), new PropertyMetadata(false));
    }
}
